XML Markup


The term markup refers to tagging electronic documents (or data stream) either to modify the appearance and formatting of text or to establish the structure and meaning (context) of a document for output to some medium (e.g., a printer or the World Wide Web). XML (Extensible Markup Language) differs from HTML (HyperText Markup Language) in that XML describes and provides structure to the content of an XML entity, whereas HTML is dedicated to the presentation of content. By breaking information into meaningful pieces, XML provides a structure for organizing that information into a meaningful whole, called a document. An XML document is a container for data, but is not necessarily intended for viewing.

Markup consists of tags that delimit different sections of content, provide references to special symbols and text macros, or give special instructions to the XML application and comments to the document's editors. (NOTE: a macro is a list of commands and/or sequence of keyboard strokes that is represented by a tag or unique name.)

The primary building block for an XML document is the element, defined by start and end tags. Every XML document contains a top-level element, called the document element or root element, which contains all other elements. XML also supports nesting of elements, which results in a tree-like, hierarchical structure. An element's name describes its content, and the structure describes the relationship between elements. A document is considered well-formed when its elements are properly marked up (tagged) and nested. The predictable pattern of XML markup means that any XML parser can read a well-formed document without knowledge of the specific format.

Although no strict rules exists about what should be defined as an element or an attribute, some of the rules of database normalization apply. A piece of information should be defined as an element if it repeats, or if it has additional properties or dependents.

Poor markup results in needlessly complex logic. An example might be using XML to mark up orders and including order items as attributes of an order (as opposed to child elements). Each occurrence of an order element would likely have a varying number of attributes, making it difficult to count, add, or remove order items.

Copyright 2000 Extensibility, Inc.

Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516